package cn.dmp.utils

import org.apache.spark.sql.types._

/**
  *
  * 将字段信息封装成，StructType(Seq(StructField("",StringType), .... ))这种的。RDD[Row]和这种StructType格式要搭配。
  */
object SchemaUtils {

  val logStructType = StructType(Seq(
    StructField("Sessionid", StringType),
    StructField("Advertisers", IntegerType),
    StructField("Adorderid", IntegerType),
    StructField("Adcreativeid", IntegerType),
    StructField("Adplatformproviderid", IntegerType),
    StructField("Sdkversion", StringType),
    StructField("Adplatformkey", StringType),
    StructField("Putinmodeltype", IntegerType),
    StructField("Requestmode", IntegerType),
    StructField("Adprice", DoubleType),
    StructField("Adpprice", DoubleType),
    StructField("Requestdate", StringType),
    StructField("Ip", StringType),
    StructField("Appid", StringType),
    StructField("Appname", StringType),
    StructField("Uuid", StringType),
    StructField("Device", StringType),
    StructField("Client", IntegerType),
    StructField("Osversion", StringType),
    StructField("Density", StringType),
    StructField("Pw", IntegerType),
    StructField("Ph", IntegerType),
    StructField("Long", StringType),
    StructField("Lat", StringType),
    StructField("Provincename", StringType),
    StructField("Cityname", StringType),
    StructField("Ispid", IntegerType),
    StructField("Ispname", StringType),
    StructField("Networkmannerid", IntegerType),
    StructField("Networkmannername", StringType),
    StructField("Iseffective", IntegerType),
    StructField("Isbilling", IntegerType),
    StructField("Adspacestype", IntegerType),
    StructField("Adspacetypename", StringType),
    StructField("Devicetype", IntegerType),
    StructField("Processnode", IntegerType),
    StructField("Apptype", IntegerType),
    StructField("District", StringType),
    StructField("Paymode", IntegerType),
    StructField("Isbid", IntegerType),
    StructField("Bidprice", DoubleType),
    StructField("Winprice", DoubleType),
    StructField("Iswin", IntegerType),
    StructField("Cur", StringType),
    StructField("Rate", DoubleType),
    StructField("Cnywinprice", DoubleType),
    StructField("Imei", StringType),
    StructField("Imac", StringType),
    StructField("Idfa", StringType),
    StructField("Openudid", StringType),
    StructField("Androidid", StringType),
    StructField("Rtbprovice", StringType),
    StructField("Rtbcity", StringType),
    StructField("Rtbdistrict", StringType),
    StructField("Rtbstreet", StringType),
    StructField("Storeurl", StringType),
    StructField("Realip", StringType),
    StructField("Isqualityapp", IntegerType),
    StructField("Bidfloor", DoubleType),
    StructField("Aw", IntegerType),
    StructField("Ah", IntegerType),
    StructField("Imeimd5", StringType),
    StructField("Macmd5", StringType),
    StructField("Idfamd5", StringType),
    StructField("Openudidmd5", StringType),
    StructField("Androididmd5", StringType),
    StructField("Imeisha1", StringType),
    StructField("Macsha1", StringType),
    StructField("Idfasha1", StringType),
    StructField("Openudidsha1", StringType),
    StructField("Androididsha1", StringType),
    StructField("Uuidunknow", StringType),
    StructField("Userid", StringType),
    StructField("Iptype", IntegerType),
    StructField("Initbidprice", DoubleType),
    StructField("Adpayment", DoubleType),
    StructField("Agentrate", DoubleType),
    StructField("Lomarkrate", DoubleType),
    StructField("Adxrate", DoubleType),
    StructField("Title", StringType),
    StructField("Keywords", StringType),
    StructField("Tagid", StringType),
    StructField("Callbackdate", StringType),
    StructField("Channeid", StringType),
    StructField("Megratype", IntegerType)
  ))

}
